// 库存管理接口
import request from "@/common/request.js";
const api = {
  product: "/product/",
  product_classify: "/product_classify/",
  unit: "/unit/",
  bom: "/bom/",
  product_cost_detail: "/product_cost_detail/",
};

const daProductApi = {
  get_product(params) {
    return request({
      url: api.product,
      method: "get",
      params,
    });
  },

  get_product_classify(params) {
    return request({
      url: api.product_classify,
      method: "get",
      params,
    });
  },

  get_unit(params) {
    return request({
      url: api.unit,
      method: "get",
      params,
    });
  },

  get_bom(params) {
    return request({
      url: api.bom,
      method: "get",
      params,
    });
  },

  product_cost_detail(params) {
    return request({
      url: api.product_cost_detail,
      method: "get",
      params,
    });
  },

  product_detail(id) {
    return request({
      url: api.product + id,
      method: "get",
    });
  },

  post_product(data) {
    return request({
      url: api.product,
      method: "post",
      data,
    });
  },

  patch_product(data, id) {
    return request({
      url: api.product + id + "/",
      method: "patch",
      data,
    });
  },

  delete_product(id) {
    return request({
      url: api.product + id + "/",
      method: "delete",
    });
  },
};
export default daProductApi
